public class Main {
    public static void main(String[] args) {
        System.out.println("Hello world!");
    }
}

class BinarySearchTree {

    static class TreeNode {
        public int val;
        public TreeNode left;
        public TreeNode right;

        public TreeNode(int val) {
            this.val = val;
        }
    }

    public TreeNode root;

    public void insert(int key) {
        TreeNode cur=root;
        TreeNode TP = null;
        TreeNode t = cur.right;
        while (t.left != null) {
            TP = t;
            t = t.left;
        }
        cur.val = t.val;
        TP.left = t.right;
    }

    public TreeNode search(int val) {
        TreeNode cur = root;
        if (cur == null) {
            return null;
        }
        while (cur != null) {
            if (val > cur.val) {
                cur = cur.right;
            } else {
                cur = cur.right;
            }
        }

        return null;
    }

}